package cn.gdpu.course.dao.impl;

import cn.gdpu.course.dao.CourseDao;
import cn.gdpu.course.dao.MybatisDao;
import cn.gdpu.course.dao.domain.Course;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2018/3/13.
 */
@Repository
public class CourseDaoImpl extends MybatisDao<Course> implements CourseDao {
	public boolean save(Course bean) {
		return this.insert("CourseMapper.insert", bean);
	}

	public boolean update(Course bean) {
		return this.insert("CourseMapper.update", bean);
	}

	public boolean updateRemain(Course bean) {
		return this.insert("CourseMapper.updateRemain", bean);
	}

	public boolean delete(Course bean) {
		return this.insert("CourseMapper.delete", bean);
	}

	public List<Course> find(Course bean) {
		return this.queryForList("CourseMapper.select", bean);
	}

	public Course findById(Course bean) {
		return this.queryForObject("CourseMapper.selectById", bean);
	}

	public Course findByBno(Course bean) {
		return this.queryForObject("CourseMapper.selectByBno", bean);
	}

	public List<Course> findByTeacher(Course bean) {
		return this.queryForList("CourseMapper.selectByTeacher", bean);
	}
}
